package com.itheima;

import com.itheima.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author: dh
 * @date: 2023-10-25 20:31
 */
public class App {

    public static void main(String[] args) {

        // 1.获得IoC容器
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 2.通过getBean方法来获得对象
        BookDao bookDao = (BookDao) ctx.getBean("bookDao");
        // 3.调用对象中的方法
        bookDao.save();
    }
}
